
//浏览器全屏
const fullScreen=()=>{
  let el = document.documentElement;
  let rfs = el.requestFullScreen || el.webkitRequestFullScreen || el.mozRequestFullScreen || el.msRequestFullscreen;      
    if(typeof rfs != "undefined" && rfs) {
        rfs.call(el);
    }
}

//是否全屏
function isFullscreenForNoScroll(){
  var explorer = window.navigator.userAgent.toLowerCase();
  if(explorer.indexOf('chrome')>0){//webkit
      if (document.body.scrollHeight === window.screen.height && document.body.scrollWidth === window.screen.width) {
        return true
      } else {
        return false
      }
  }else{//IE 9+  fireFox
      if (window.outerHeight === window.screen.height && window.outerWidth === window.screen.width) {
        return true
      } else {
        return false
      }
  }
}


//退出全屏
function excitFullScreen(){
  if (document.exitFullscreen) {  
    document.exitFullscreen();  
  }  
  else if (document.mozCancelFullScreen) {  
    document.mozCancelFullScreen();  
  }  
  else if (document.webkitCancelFullScreen) {  
    document.webkitCancelFullScreen();  
  }  
  else if (document.msExitFullscreen) {  
    document.msExitFullscreen();  
  } 
  if(typeof cfs != "undefined" && cfs) {
    cfs.call(el);
  }//全屏退出
}